import requests
import pprint
import json
#https://game.gtimg.cn/images/lol/act/img/skin/small17001.jpg
url='https://game.gtimg.cn/images/lol/act/img/js/heroList/hero_list.js'
headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
    }
response=requests.get(url,headers=headers)
print(response)
data=response.json()#.json转换成列表或字典
print(data)
# pprint.pprint(data)
data_list=data['hero']
# for hero_data in data_list:
#     # print(hero_data)
#     here_id=hero_data['heroId']
#     hero_url='https://game.gtimg.cn/images/lol/act/img/js/hero/{}.js'.format(here_id)
#     response1 = requests.get(hero_url, headers=headers,)
#     response1.encoding = response1.apparent_encoding
#     data1 = response1.json()
#     print(data1)
#     skins = data1['skins']
#     url_list=[]
#     for skin in skins:
#         name = skin['name']+'.jpg'
#         skin_id = skin['skinId']
#         # print(name,skin_id)
#         skin_url='https://game.gtimg.cn/images/lol/act/img/skin/big{}.jpg'.format(skin_id)
#         url_list.append(skin_url)
# print(url_list)
#a=['https://game.gtimg.cn/images/lol/act/img/skin/big875000.jpg', 'https://game.gtimg.cn/images/lol/act/img/skin/big875001.jpg', 'https://game.gtimg.cn/images/lol/act/img/skin/big875002.jpg', 'https://game.gtimg.cn/images/lol/act/img/skin/big875003.jpg', 'https://game.gtimg.cn/images/lol/act/img/skin/big875004.jpg', 'https://game.gtimg.cn/images/lol/act/img/skin/big875005.jpg', 'https://game.gtimg.cn/images/lol/act/img/skin/big875006.jpg', 'https://game.gtimg.cn/images/lol/act/img/skin/big875007.jpg']